package org.keqinglee.study.spi;

import java.util.ServiceLoader;

/**
 * @author: keqinglee
 * @date: 2021/10/28 13:47
 */
public class Test {

    public static void main(String[] args) {
        /**
         * spi = service provider interface 服务提供者接口实现
         */
        ServiceLoader<Car> carList = ServiceLoader.load(Car.class);
        for (Car car : carList) {
            System.out.println(car.getName());
        }
    }
}
